q4k mmq optimizations - #80
Merged
Merged
Conversation
Pipeline Q4_K tile loads with split WMMA dequantization and select the measured tile width by matrix shape. Assisted-by: GPT-5.6 Sol Co-authored-by: Cursor <cursoragent@cursor.com>
Match the refactored 32-row warp layout and limit the specialized J64 path to the small shape where it provides a stable gain. Assisted-by: GPT-5.6 Sol Co-authored-by: Cursor <cursoragent@cursor.com>
Use the generic vec-dot with J64 two-row waves and J128 one-row waves, retaining the J64 prefetch loop for the best measured shape coverage. Assisted-by: GPT-5.6 Sol Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid overriding MoE's per-expert tile selection with the dense Q4_K pipeline policy. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep production dispatch shape-driven and avoid exposing an experimental tile-width environment knob. Co-authored-by: Cursor <cursoragent@cursor.com>
liangliangchang
marked this pull request as ready for review
August 12, 2026 17:56
Reuse the validated next-weight pipeline for J128 to improve large Q4_K MMQ throughput without retaining experimental pacing controls. Co-authored-by: Cursor <cursoragent@cursor.com>
Separate low and high nibble WMMA phases across J128 tiles to retain the faster dequantization schedule with next-weight prefetch. Co-authored-by: Cursor <cursoragent@cursor.com>
liangliangchang
requested review from
Annieren,
jimw567,
mgehre-amd and
roberteg16
August 13, 2026 23:57
Collaborator
|
Is the regression on Qwen3.5-4B_Q4_K_M_GGUF_baseline_code reproducible? If yes, any idea how to avoid it? |
mgehre-amd
reviewed
Aug 17, 2026
mgehre-amd
reviewed
Aug 17, 2026
mgehre-amd
reviewed
Aug 17, 2026
Collaborator
|
Is this covered by unit tests in tests/test-backend-ops.cpp? |
mgehre-amd
approved these changes
Aug 17, 2026
Compile the Q4_K batched WMMA path under RDNA3_5 only, and add a 4096x1024x12288 Q4_K MMQ case so occupancy-selected J=128 is covered. Co-authored-by: Cursor <cursoragent@cursor.com>
Author
It is not reproducible. Also, baseline code uses input token size 32, it won't go through the path added in this PR. |
Author
It is covered by cases already in. Just added one more with larger N. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
lichang.q4k-optq4k-optthroughputAdditional information
Requirements